import {PageType} from "@/api/type";
import {SocBard} from "@/api/social/bard/type";

export interface SocPost {
    postId?: string | null,
    userId: string | null,
    bardId: string,
    schoolId: string,
    title: string,
    content: string,
    categoryId?: number | string,
    /**
        * 范围（0公开，1本校，2仅好友，3私有）
    */
    range: number,
    status: number,
    synopsis: string,//简介
    likes: number,
    createdTime: Date | null,
    updateTime: Date | null
}

export interface SocTags{
    tagId?: string,
    tagName: string,
    postId?: string,
    createTime?: Date,
    updateTime?: Date
}
export interface SocPostCreateDTO extends SocPost {
    uploadFileList: SocPostFile[],
    tags: SocTags[]
}
/**
 * 帖子文件类型
 */
export interface SocPostFile {
    fileId?: number,
    postId?: number,
    fileUrl: string,
    fileType: string,
    createTime?: string
}
/**
 * 帖子显示的vo类型
 */
export interface SocPostItemVO extends SocPost {
    avatar: string,
    nickname: string,
    likes: number
    remarks: number
    files: SocPostFile[]
}
export interface SocPostReplies {
    replyId?: string | number,
    postId?: string,
    userId?: string | null,
    parentId:number,
    content: string,
    status: number,
    createdTime?: Date,
}
export interface SocPostRepliesVO extends SocPostReplies{
    files: SocPostFile[],
    nickname:string,
    avatar:string
}
export interface SocPostInfoVO extends SocPostItemVO{
    replies:PageType<SocPostRepliesVO>
    userInfo:PostUserInfoVO
    otherPosts?:PageType<SocPostItemVO>
    isLiked: boolean,
}
export interface SocPostRepliesFile {
    fileId?: number,
    postReplyId: number | string,
    fileUrl: string,
    fileType: string,
}
export interface SocPostReplyDTO extends SocPostReplies {
    files: SocPostRepliesFile[],
}
export interface PostUserInfoVO{
    userId:string,
    avatar:string,
    sex:number,
    nickname:string,
    bardName:string,
    /**
     *发帖数
     */
    postCount : number;
    /**
     *关注数
     */
    followCount :number,
    followBards:SocBard[],
    publishPosts: SocPost[]
}
export interface SocPostLikes{
    postId:string |number,
    userId?:string |number,
    createTime?:Date
}
export interface SocPostCategory{
    categoryId?:number,
    parentId?:number,
    name:string,
    level:number,
    description:string,
    sort:number,
}
export interface SocPostCategoryTrreVO extends SocPostCategory{
    children?:SocPostCategoryTrreVO[]
}

